#ifndef STATE_H
#define STATE_H

#include <iostream>
#include "StateEnum.h"
#include <functional>
#include "SFML\Graphics.hpp"
#include "RenderingEngine.h"
#include  "eventEnum.h"
#include "EventParser.h"
#include "SpriteManager.h"
#include "MusicPlayer.h"





class State
{
public:

	State(const std::function<void(StateEnum STATE)> &giveTokenTo, RenderingEngine &render, EventParser &eventParser,SpriteManager &SpriteManager, MusicPlayer &musicPlayer );
	void activate();
	virtual void loop()=0;
	virtual void init();
	
	
protected:
	const std::function<void(StateEnum state)> _giveTokenTo;	
	RenderingEngine &_render;
	EventParser &_eventParser;
	SpriteManager &_SpriteManager;
	MusicPlayer &_musicPlayer;
	virtual void interpretInput(EventEnum input);
	virtual void interpretMouse(const sf::Vector2f&);
	
	void leaveState();
	bool isLeavingState = false;   //trigger sur la sorti d'un state
	sf::CircleShape newCursor;

};







#endif